package com.htl.exampro.course.pojo.domain;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 课程章节表
 * </p>
 *
 * @author hehehe
 * @since 2025-05-26
 */
@Data
@TableName("chapter")
@Schema(name = "ChapterDO", description = "课程章节表")
public class ChapterDO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    public static final String RESULT_ID = "result_id";
    public static final String EXAM_ID = "exam_id";
    public static final String USER_ID = "user_id";
    public static final String TOTAL_SCORE = "total_score";
    public static final String STATUS = "status";
    public static final String GRADED_PERSON = "graded_person";
    public static final String GRADED_TIME = "graded_time";
    public static final String CREATED_PERSON = "created_person";
    public static final String CREATED_TIME = "created_time";
    public static final String UPDATED_PERSON = "updated_person";
    public static final String UPDATED_TIME = "updated_time";
    public static final String IS_DELETED = "is_deleted";
    /**
     * 课程章节ID
     */
    @Schema(description = "课程章节ID")
    @TableId(value = "chapter_id", type = IdType.ASSIGN_ID)
    private Long chapterId;

    /**
     * 关联课程ID
     */
    @TableField("course_id")
    @Schema(description = "关联课程ID")
    private Long courseId;

    /**
     * 父章节ID（用于章节分级）
     */
    @TableField("parent_id")
    @Schema(description = "父章节ID（用于章节分级）")
    private Long parentId;

    /**
     * 章节名称（如：第一章 绪论）
     */
    @TableField("chapter_name")
    @Schema(description = "章节名称（如：第一章 绪论）")
    private String chapterName;

    /**
     * 章节具体教学内容描述
     */
    @TableField("content")
    @Schema(description = "章节具体教学内容描述")
    private String content;

    /**
     * 教学视频资源链接地址
     */
    @TableField("video_url")
    @Schema(description = "教学视频资源链接地址")
    private String videoUrl;

    /**
     * 教学文档/作业等附件下载链接
     */
    @TableField("attachment_url")
    @Schema(description = "教学文档/作业等附件下载链接")
    private String attachmentUrl;

    /**
     * 章节显示顺序（数值越小越靠前）
     */
    @TableField("sort_order")
    @Schema(description = "章节显示顺序（数值越小越靠前）")
    private Integer sortOrder;

    /**
     * 创建人ID
     */
    @TableField(value = "created_person" ,fill = FieldFill.INSERT)
    @Schema(description = "创建人ID")
    private String createdPerson;

    /**
     * 创建时间
     */
    @TableField("created_time")
    @Schema(description = "创建时间")
    private LocalDateTime createdTime;

    /**
     * 修改人ID
     */
    @TableField(value = "updated_person" ,fill = FieldFill.UPDATE)
    @Schema(description = "修改人ID")
    private String updatedPerson;

    /**
     * 修改时间
     */
    @TableField("updated_time")
    @Schema(description = "修改时间")
    private LocalDateTime updatedTime;

    /**
     * 逻辑删除标志 0-未删除 1-已删除
     */
    @TableLogic
    @TableField("is_deleted")
    @Schema(description = "逻辑删除标志 0-未删除 1-已删除")
    private Boolean isDeleted;
}
